
$(function() {
	
	_change("input[id='invoice']:visible", "select[id^='invoice_t']:visible");
	
	$('#invoice').change(function() {		
		_invoice($(this).val());
	});
	
	$('#invoice').blur(function() {		
		_invoice($(this).val());
	});
	
	$('#invoice_t').change(function() {
		var s = $(this).val();
		if (s != null && s != '-')　{
			$('#invoice').val(s);
			
			_invoice(s);
		}
	});
	
	$("input[id^='date']:visible").datepicker(_date1_option);
	
	$('textarea').css("width", 400);
});

function _invoice(s) {
	var body = { };
	body.id = s;
	
	$.getJSON('finance.php?do=Invoice.ajax_id', body, function(json) {
		
		$("#date1").val(json.date);
	});
}
   